#include"MyTask1.h"
MyTask1::MyTask1(TaskQenen &task)
:_task(task){}
MyTask1::~MyTask1(){
    cout<<"~MyTask()"<<endl;
}
void MyTask1::process(){
    int cnt = 5;
    while(cnt-- > 0)
    {
        int number = ::rand() %100;
        //其实就是为了去将任务放在TaskQueue
        _task.push(number);
        cout << ">>Producer produce " << number << endl;
        //生产速度慢一点
        sleep(1);
    }
}